<template>
  <div class="school">
    <h2>学校名称: {{ name }}</h2>
    <h2>学校地址：{{ address }}</h2>
    <button @click="hello">点我传递数据</button>
  </div>
</template>

<script>
export default ({
  name: 'school',
  data() {
    return {
      name: "尚硅谷",
      address: '北京',
    }
  },
  mounted() {
    // console.log('school', this);
  },
  methods: {
    hello() {
      this.$bus.$emit('hello', this.name);
    }
  }
})
</script>

<style  lang="less" scoped>
.school {
  background-color: skyblue;
  padding: 5px;
}
</style>

